
/**
 * UserVO
 * @type {{userId: string, username: string,role: string}}
 */
export const UserVO = {
    userId: '', //后端为 Long
    username: '',
    // password: '',
    role: '',
}

/**
 * LoginDTO
 * @type {{username: string, password: string, checkCode: number}}
 */
export const LoginDTO = {
    username: '',
    password: '',
    checkCode: null,
}

/**
 * RegisterDTO
 * @type {{username: string, password: string, surePassword: string, checkCode: number}}
 */
export const RegisterDTO = {
    username: '',
    password: '',
    surePassword: '',
    checkCode: null,
}

/**
 * UserUpdateDTO
 * @type {{userId: string, username: string, oldPassword: string, newPassword: string}}
 */
export const UserUpdateDTO = {
    userId: '', //后端为 Long
    username: '',
    oldPassword: '',
    newPassword: '',
}

export const RoleType = ['user', 'admin'];

export const roleText = (role) => {
    return role === 'user' ? '普通用户' : role === 'admin' ? '管理员' : '未 知';
}